<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
.styled:visited span {
  color: red;
}

.styled:visited > span {
  color: green;
}
</style>
<a class="styled" href="">
  <span>Should be green</span>

  (<a href=""><span>Should not be red</span></a>)
</a>
</html>
